extern void _putc(int addr, char c);

void putc_ex(int h, int l, char c)
{
	int i;

	i = (80 * h + l) * 2;
	_putc(i, c);
}

void puts_ex(int h, int l, const char *s)
{
	int i;

	for(i = 0; i < 255 && s[i] != '\0'; i++)
	{
		putc_ex(h, l + i, s[i]);
	}
}

void puti_ex(int h, int l,int num)
{
	char T[10] = {0};
	int i, j, k, tmp;

	if(0 >= num)
	{
		putc_ex(h, l, '0');
		return;
	}

	for(i = 9; i >= 0; i--)
	{
		tmp = num % 10;
		T[i] = (char)(tmp + 48);
		num /= 10;
	}

	for(i = 0, j = 0, k = 0; i < 10; i++)
	{
		if(T[i] > '0')
		{
			k++;
		}

		if(k > 0)
		{
			putc_ex(h, l + j, T[i]);
			j++;
		}
	}

	return;
}
